//
//  SCVideoPlayViewController.m
//  OurMoon
//
//  Created by dllo on 15/11/3.
//  Copyright © 2015年 sc. All rights reserved.
//

#import "SCVideoPlayViewController.h"
#import "AVPlayer_S.h"
@interface SCVideoPlayViewController ()

@end

@implementation SCVideoPlayViewController

- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBarHidden = YES;
    
    self.navigationController.navigationBar.translucent = YES;
    
    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeSystem];
    button1.frame = CGRectMake(0, 20, 40, 40);
    [button1 setImage:[UIImage imageNamed:@"iconfont-fanhui"] forState:UIControlStateNormal];
    [self.view addSubview:button1];
    [button1 addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside];
}
- (void)viewWillDisappear:(BOOL)animated
{
    self.navigationController.navigationBarHidden = NO;
    
    self.navigationController.navigationBar.translucent = NO;
}
- (void)goBack
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)loadView
{
    [super loadView];
    UIView *barView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 20)];
    barView.backgroundColor = [UIColor blackColor];
    [self.view addSubview:barView];
    AVPlayer_S *avPlayer = [[AVPlayer_S alloc] initWithFrame:CGRectMake(0, barView.frame.origin.y + barView.frame.size.height, self.view.frame.size.width, 200) videoURL:_videoListModel.mp4_url];
    [self.view addSubview:avPlayer];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
